import {defineConfig} from "vite";
import tailwindcss from 'tailwindcss';
import uni from "@dcloudio/vite-plugin-uni";
import uniTailwind from '@uni-helper/vite-plugin-uni-tailwind';
import AutoImport from 'unplugin-auto-import/vite';
import Components from '@uni-helper/vite-plugin-uni-components';
import {UvResolver} from "@uni-helper/vite-plugin-uni-components/resolvers";

export default defineConfig({
    css: {
        postcss: {
            plugins: [tailwindcss()]
        }
    },
    plugins: [
        Components({
            resolvers: [UvResolver()],
            dts: "components.d.ts"
        }),
        uni(),
        uniTailwind(),
        AutoImport({
            imports: ['vue', 'uni-app', 'pinia'],
            dirs: ["./src/services", "./src/utils"],
            dts: 'auto-import.d.ts'
        })
    ]
});
